package com.linewell.dao.impl;

import com.linewell.dao.TagMapper;
import com.linewell.entity.Article;
import com.linewell.entity.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Title: ssm2
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/2/5
 */
@Repository
public class TagDao implements TagMapper{
    @Autowired
    TagMapper tagMapper;

    public List<Tag> getHotTag() {

        return tagMapper.getHotTag();
    }

    public List<Tag> getCountTag() {
        return tagMapper.getCountTag();
    }

    public List<Tag> getTags() {
        return tagMapper.getTags();
    }


    public void insertTag(String tag) {
        tagMapper.insertTag(tag);
    }

    public List<Tag> selectTagByTagName(String tag) {
        return tagMapper.selectTagByTagName(tag);
    }

    public void insertMutil(Long articleId, int tagId) {
        tagMapper.insertMutil(articleId,tagId);
    }

    public int selectUserTag(Long userId) {
        return tagMapper.selectUserTag(userId);
    }

    public void insertMutilByArticle(long articleId, int tagId) {
        tagMapper.insertMutilByArticle(articleId,tagId);
    }


    public void insertUserTag(Long userId, int tagId) {
        tagMapper.insertUserTag(userId,tagId);
    }


    public Long[] selectTagId(Long userId) {
        return tagMapper.selectTagId(userId);
    }

    public void updateUserTag(Long tId, int tagId) {
        tagMapper.updateUserTag(tId,tagId);
    }

    public List<Tag> getTagByArticle(Article article) {
        return tagMapper.getTagByArticle(article);
    }
}
